package day7;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class FAnxing {
    public static void main(String[] args) {
        //Map<Character,Integer>m=new HashMap<>();
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (map.containsKey(c)) {
                map.put(c, map.get(c) + 1);
            } else {
                map.put(c, 1);
            }
        }

        List<Map.Entry<Character, Integer>> list = new ArrayList<>(map.entrySet());
        //Collections.sort(list, (a, b) -> b.getValue().compareTo(a.getValue()));
       Collections.sort(list, new T());

        for (Map.Entry<Character, Integer> entry : list) {
            System.out.println(entry.getKey() + "\t" + entry.getValue());
        }
    }
}
class T implements Comparator<Map.Entry<Character, Integer>>{

    @Override
    public int compare(Map.Entry<Character, Integer> o1, Map.Entry<Character, Integer> o2) {
        return o2.getValue()-o1.getValue();
    }
}